Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): don't use pip3 to install awscli #3786

Merged
merged 2 commits into from
Apr 24, 2024
Merged

Conversation

rami3l
Copy link
Member

@rami3l rami3l commented Apr 23, 2024

The current stable CI is almost perfect except it gives this error on macos-14:

$ pip3 install awscli
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try brew install
    xyz, where xyz is the package you are trying to
    install.
    
    If you wish to install a Python library that isn't in Homebrew,
    use a virtual environment:
    
    python3 -m venv path/to/venv
    source path/to/venv/bin/activate
    python3 -m pip install xyz
    
    If you wish to install a Python application that isn't in Homebrew,
    it may be easiest to use 'pipx install xyz', which will manage a
    virtual environment for you. You can install pipx with
    
    brew install pipx
    
    You may restore the old behavior of pip by passing
    the '--break-system-packages' flag to pip, or by adding
    'break-system-packages = true' to your pip.conf file. The latter
    will permanently disable this error.
    
    If you disable this error, we STRONGLY recommend that you additionally
    pass the '--user' flag to pip, or set 'user = true' in your pip.conf
    file. Failure to do this can result in a broken Homebrew installation.
    
    Read more about this behavior here: <https://peps.python.org/pep-0668/>

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

This is actions/runner-images#8615; it so happened that when we were releasing v1.27.0, pip3 was on Python v3.11, so that didn't bring up any error message.

Since awscli is already bundled in macos-(12|14) and ubuntu-*, pip3 install awscli actually has no effect. I think it’d be better to make the installation line a version check instead.
For windows runners, the existing awscli is already choco-managed, so there's nothing to be done.

It's worth noticing that the preinstalled awscli is on v2, but on pip we have awscli 1.32.89 as the latest version. However, given that we've already used the v2 for release purposes unintentionally for quite a while now, the differences here regarding the specific aws s3 cp command should be minimal.

This fix cannot be properly tested since it touches some part of the release process, but the aws --version part has been tested and is guaranteed to work.

@rami3l rami3l requested review from djc and rbtcollins April 23, 2024 14:21
@rami3l rami3l enabled auto-merge April 23, 2024 14:37
@rami3l rami3l added this to the 1.27.1 milestone Apr 24, 2024
@rami3l rami3l disabled auto-merge April 24, 2024 01:30
@rami3l

This comment was marked as resolved.

@rami3l rami3l marked this pull request as draft April 24, 2024 01:38
@rami3l rami3l changed the title fix(ci): use brew to install awscli on macOS runners fix(ci): don't use pip3 to install awscli on macOS runners Apr 24, 2024
@rami3l rami3l changed the title fix(ci): don't use pip3 to install awscli on macOS runners fix(ci): fix error on pip3 install awscli Apr 24, 2024
@rami3l rami3l force-pushed the fix/dist-awscli-macos branch from 331ccbb to e44ba70 Compare April 24, 2024 02:52
@rami3l rami3l marked this pull request as ready for review April 24, 2024 02:54
@rami3l rami3l force-pushed the fix/dist-awscli-macos branch from dcb559c to 2e52628 Compare April 24, 2024 03:01
@rami3l rami3l changed the title fix(ci): fix error on pip3 install awscli fix(ci): don't use pip3 to install awscli Apr 24, 2024
@rami3l rami3l force-pushed the fix/dist-awscli-macos branch from 2e52628 to 6bf342a Compare April 24, 2024 03:12
@rami3l rami3l enabled auto-merge April 24, 2024 03:36
@rami3l rami3l added this pull request to the merge queue Apr 24, 2024
@djc
Copy link
Contributor

djc commented Apr 24, 2024

Nice work looking into this!

Merged via the queue into master with commit a8e4f5c Apr 24, 2024
22 checks passed
@rami3l rami3l deleted the fix/dist-awscli-macos branch April 24, 2024 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants